package com.api.wall.deletefromcompanyfeed;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.test.context.ContextConfiguration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import com.api.test.AbstractApiTest;
import com.zyncro.api.IWallApiService;
import com.zyncro.api.exceptions.ZyncroApiException;

@ContextConfiguration(locations = { "classpath:/wall/wall-context.xml" })
public class DeleteFromCompanyFeedNotCompanyFeeder extends AbstractApiTest {

	@Value("#{org_wall[notCompanyFeeder].appId}")
	private String userUrn;

	@Value("#{org_wall[notCompanyFeeder].password}")
	private String userPassword;

	@Value("#{org_wall.companyFeedEvent}")
	private String companyFeedEventUrn;

	@BeforeClass
	protected void setParameters() throws Exception {

		getApi().login(userUrn, userPassword);
	}

	@Test(expectedExceptions = ZyncroApiException.class, expectedExceptionsMessageRegExp = "User has no rights")
	public void testPublishCompanyFeed() throws ZyncroApiException {

		getApi().getService(IWallApiService.class).deleteFromCompanyFeed(companyFeedEventUrn);
	}
}
